require("RecorderItem")
require("Object")

Object:sub("RecorderList")

RecorderList.data = {}

--新增
function RecorderList:Add(item)
	if self.data == nil then
		self.data = {}
	end
	table.insert(self.data,item)
end

--移除
function RecorderList:Remove(order)
	for i,v in pairs(self.data) do
		if v.Order == order then
			self.data[i] =nil
		end
	end
end

--查询
function RecorderList:Get(order)
	for i,v in pairs(self.data) do
		if v.Order == order then
			return v
		end
	end
end

--重排序
function RecorderList:ReOrder()
	table.sort(self.data,function(item1,item2)
		return item1.Order < item2.Order
end)
end